From: Florian Müllner Date: Mon, 20 Mar 2023 00:41:15 +0000 (+0100) Subject: ci: Use built-in option parsing in meson-install X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~371^2^2~12 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cdd8d335870481a3a994ab4673dc44e97a78e761;p=gnome-shell.git ci: Use built-in option parsing in meson-install This is less concise than the current ad-hoc parsing, but gets us error handling ("unknown option --foo") and is easier to extend. Part-of: --- diff --git a/.gitlab-ci/install-meson-project.sh b/.gitlab-ci/install-meson-project.sh index fbb62b9d0..c49d50c7f 100755 --- a/.gitlab-ci/install-meson-project.sh +++ b/.gitlab-ci/install-meson-project.sh @@ -14,11 +14,28 @@ usage() { EOF } +TEMP=$(getopt \ + --name=$(basename $0) \ + --options=D \ + -- "$@") + +eval set -- "$TEMP" +unset TEMP + MESON_OPTIONS=() -while [[ $1 =~ ^-D ]]; do - MESON_OPTIONS+=( "$1" ) - shift +while true; do + case "$1" in + -D) + MESON_OPTIONS+=( -D$2 ) + shift 2 + ;; + + --) + shift + break + ;; + esac done if [[ $# -lt 4 ]]; then